package com.jtjrenren.android.taxi.passenger.bean;

import com.baidu.mapapi.model.LatLng;
import com.library.utils.StringUtils;

import java.io.Serializable;

/**
 * Created by Administrator on 2016/1/13.
 */
public class AddressInfo implements Serializable{
    private String id;
    private String name;
    private String lati;
    private String longi;
    private String addr;
    private int type;// 用于区分是什么类型的地址 家 公司  或者其他的
    private int count; //选择的次数

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLati() {
        return lati;
    }

    public void setLati(String lati) {
        this.lati = lati;
    }

    public String getLongi() {
        return longi;
    }

    public void setLongi(String longi) {
        this.longi = longi;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public void setLatLng(LatLng ll){
        lati=String.valueOf(ll.latitude);
        longi=String.valueOf(ll.longitude);
    }

    public LatLng getLatLng(){
        if (!StringUtils.isEmpty(lati)&&!StringUtils.isEmpty(longi))
            return new LatLng(Double.parseDouble(lati),Double.parseDouble(longi));
        return null;
    }

    @Override
    public String toString() {
        return "AddressInfo{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", lati='" + lati + '\'' +
                ", longi='" + longi + '\'' +
                ", addr='" + addr + '\'' +
                ", type=" + type +
                ", count=" + count +
                '}';
    }
}
